I'm gonna overwrite a lot of this notebook's old content. I changed the way I'm calculating wt, and wanna test that my training worked.
In [1]:
from pearce.emulator import *
from pearce.mocks import cat_dict
import numpy as np
from os import path
In [2]:
import matplotlib
#matplotlib.use('Agg')
from matplotlib import pyplot as plt
%matplotlib inline
import seaborn as sns
sns.set()
In [3]:
training_file = '/home/users/swmclau2/scratch/xi_zheng07_cosmo_lowmsat/PearceRedMagicXiCosmoFixedNd.hdf5'
test_file = '/home/users/swmclau2/scratch/xi_zheng07_cosmo_test_lowmsat2/PearceRedMagicXiCosmoFixedNd_Test.hdf5'
em_method = 'gp'
In [4]:
a = 1.0
z = 1.0/a - 1.0
In [5]:
scale_bin_centers = np.array([ 0.09581734, 0.13534558, 0.19118072, 0.27004994,
0.38145568, 0.53882047, 0.76110414, 1.07508818,
1.51860241, 2.14508292, 3.03001016, 4.28000311,
6.04566509, 8.53972892, 12.06268772, 17.0389993 ,
24.06822623, 33.99727318])
In [6]:
fixed_params = {'z':z, 'r': scale_bin_centers[-2]}
In [7]:
from george.kernels import *
N = 11#4
kernel = 1.0*ExpSquaredKernel(np.ones(N,), ndim = N)# + LinearKernel(ndim = N, order = 1, log_gamma2 = 0.0)
#kernel = DotProductKernel(ndim = N)
In [8]:
emu = OriginalRecipe(training_file, method = em_method, fixed_params=fixed_params,\
downsample_factor=0.01, hyperparams = {'kernel': kernel})
In [9]:
emu.downsample_x.shape
Out[9]:
In [10]:
emu.get_param_names()
Out[10]:
In [11]:
emu.train_metric()
Out[11]:
In [12]:
acc = emu.goodness_of_fit(test_file, statistic = 'frac')
In [13]:
print acc.mean()
In [ ]: